﻿// -----------------------------------------------------------------------
// <copyright file="VisibilityConverter.cs" company="R&R">
// TODO: Update copyright text.
// </copyright>
// -----------------------------------------------------------------------

#region Imports
using System;
using System.Globalization;
using System.Windows;
using System.Windows.Data;
#endregion Imports

namespace Domino
{
    public class VisibilityConverter : IValueConverter
    {
        #region IValueConverter Members
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            bool bln = false;
            Boolean.TryParse(value.ToString(), out bln);
            if (System.Convert.ToString(parameter) == "-") bln = !bln;

            return bln ? Visibility.Visible : Visibility.Collapsed;
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException();
        }
        #endregion IValueConverter Members
    }
}
